package com.sudo.dao.admin.entity;

import com.sudo.common.annotation.mybatis.FileDomainPrefix;
import com.sudo.common.annotation.mybatis.ResultHandler;
import com.sudo.dao.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@ResultHandler
@Table(name = "sys_user")
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity {
    /**
     * 乐观锁
     */
    @Id
    private Integer id;

    /**
     * 登录名 创建后不能修改
     */
    @Column(name = "username")
    private String username;

    /**
     * 邮箱 注册邮箱
     */
    @Column(name = "mail")
    private String mail;

    /**
     * 昵称
     */
    @Column(name = "nick_name")
    private String nickName;

    /**
     * 密码
     */
    private String password;

    /**
     * 账户状态
     */
    private String status;

    /**
     * 来源
     */
    private String source;

    /**
     * 备注
     */
    private String note;

    /**
     * 签名
     */
    private String signature;
    /**
     * 用户头像
     */
    @FileDomainPrefix
    @Column(name = "profile_photo")
    private String profilePhoto;
    /**
     * 职位
     */
    private String position;
    /**
     * 生日
     */
    private String birthday;

    public interface Field{
        String id = "id";
        String username = "username";
        String mail = "mail";
        String nickName = "nickName";
        String password = "password";
        String status = "status";
        String source = "source";
        String note = "note";
        String signature = "signature";
        String profilePhoto = "profilePhoto";
        String position = "position";
        String birthday = "birthday";
    }
}
